/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #e8eaf6;
    background-image: linear-gradient(135deg, #c5cae9 0%, #e8eaf6 50%, #bbdefb 100%);
    color: #495057;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 暗色模式 */
body.dark-mode {
    background-color: #121212;
    background-image: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #e0e0e0;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    margin-left: 20px;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

body.dark-mode .theme-toggle {
    color: #e0e0e0;
}



/* 主容器样式 */
.main-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 30px);
    max-width: 1600px;
    margin: 15px auto;
    padding: 0 15px;
    gap: 15px;
    overflow: hidden;
}

/* 面板通用样式 */
.panel {
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 22px;
    margin-bottom: 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .panel {
    background-color: rgba(30, 30, 30, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.panel h3 {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.center-panel h3 {
    font-size: 24px;
    font-weight: 700;
    color: #495057;
    text-align: center;
    margin: -22px -22px 15px -22px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark-mode .center-panel h3 {
    color: #81d4fa;
    background: linear-gradient(135deg, #263238 0%, #37474f 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .panel h3 {
    color: #81d4fa;
    border-bottom: 1px solid #37474f;
}

/* 左侧面板 - 知识库上传 */
.left-panel {
    flex: 0 0 280px;
    min-width: 260px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-left: 5px solid #90caf9;
    border-top: 1px solid rgba(144, 202, 249, 0.2);
    border-right: 1px solid rgba(144, 202, 249, 0.2);
    border-bottom: 1px solid rgba(144, 202, 249, 0.2);
}

/* 中间面板 - 对话区域 */
.center-panel {
    flex: 3;
    min-width: 500px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-left: 5px solid #90caf9;
    border-top: 1px solid rgba(144, 202, 249, 0.2);
    border-right: 1px solid rgba(144, 202, 249, 0.2);
    border-bottom: 1px solid rgba(144, 202, 249, 0.2);
}

/* 右侧面板 - 辅助功能 */
.right-panel {
    flex: 0 0 260px;
    min-width: 240px;
    overflow-y: auto;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 136, 209, 0.3) transparent;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-left: 5px solid #90caf9;
    border-top: 1px solid rgba(144, 202, 249, 0.2);
    border-right: 1px solid rgba(144, 202, 249, 0.2);
    border-bottom: 1px solid rgba(144, 202, 249, 0.2);
}

.right-panel::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 10px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: rgba(179, 229, 252, 0.6);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.right-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 212, 250, 0.8);
}

body.dark-mode .right-panel::-webkit-scrollbar-track {
    background: rgba(55, 71, 79, 0.3);
}

body.dark-mode .right-panel::-webkit-scrollbar-thumb {
    background: rgba(129, 212, 250, 0.4);
}

body.dark-mode .right-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 212, 250, 0.6);
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #ced4da;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(108, 117, 125, 0.03), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    animation: gradientFlow 8s linear infinite;
}

@keyframes gradientFlow {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

body.dark-mode .upload-area {
    border-color: #37474f;
    background-color: #263238;
}

.upload-area:hover {
    border-color: #adb5bd;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

body.dark-mode .upload-area:hover {
    border-color: #81d4fa;
    background-color: #37474f;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #6c757d;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-text {
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
}

/* 上传文件列表 */
.uploaded-files {
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

body.dark-mode .file-item {
    background-color: #263238;
}

.file-name {
    flex: 1;
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #495057;
}

.file-size {
    color: #6c757d;
    font-size: 12px;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.file-actions button {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
}

/* 按钮样式 */
.primary-button {
    width: 80%;
    background: linear-gradient(135deg, #c5cae9 0%, #9fa8da 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(197, 202, 233, 0.3);
    position: relative;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.primary-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.primary-button:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.primary-button:hover {
    background: linear-gradient(135deg, #9fa8da 0%, #7986cb 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(159, 168, 218, 0.4);
}

body.dark-mode .primary-button {
    background-color: #0277bd;
}

body.dark-mode .primary-button:hover {
    background-color: #01579b;
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.5);
}

.secondary-button {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

body.dark-mode .secondary-button {
    background-color: #263238;
    color: #81d4fa;
    border: 1px solid #37474f;
}

body.dark-mode .secondary-button:hover {
    background-color: #37474f;
}

/* 处理状态 */
.processing-status {
    border: 1px solid #e1f5fe;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

body.dark-mode .processing-status {
    border: 1px solid #37474f;
}

.status-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    font-weight: 500;
    border-bottom: 1px solid #dee2e6;
    color: #9fa8da;
}

body.dark-mode .status-header {
    background-color: #263238;
    border-bottom: 1px solid #37474f;
    color: #81d4fa;
}

.status-content {
    padding: 15px;
    min-height: 100px;
}

.status-waiting {
    color: #6c757d;
    font-style: italic;
}

.status-result {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}

.status-icon {
    margin-right: 8px;
    flex-shrink: 0;
}

.status-text {
    flex: 1;
}

/* 搜索选项 */
.search-options {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    gap: 15px;
}

.search-toggle, .retrieval-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.toggle-label {
    font-weight: 500;
    color: #9fa8da;
    font-size: 14px;
}

body.dark-mode .toggle-label {
    color: #9575cd;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c5cae9;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #9fa8da;
}

input:focus + .slider {
    box-shadow: 0 0 1px #9fa8da;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 单选按钮样式 */
.radio-group {
    display: flex;
    gap: 15px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-container input {
    position: absolute;
    opacity: 0;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #c5cae9;
    margin-right: 6px;
    position: relative;
    transition: all 0.3s;
}

.radio-container input:checked + .radio-custom {
    border-color: #9fa8da;
}

.radio-container input:checked + .radio-custom:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #9fa8da;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label {
    font-size: 14px;
    color: #9fa8da;
    font-weight: 500;
}

/* 示例问题区域 */
.examples-section {
    margin-bottom: 20px;
}

.examples-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #01579b;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode .examples-title {
    color: #81d4fa;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.example-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #444444;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .example-item {
    background-color: #263238;
    border: 1px solid #37474f;
    color: #b0b0b0;
}

.example-item:hover {
    background: rgba(156, 39, 176, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 选项卡样式 - 隐藏选项卡 */
.tabs {
    display: none;
    background-color: #e1f5fe;
    border-bottom: 1px solid #b3e5fc;
    margin-bottom: 10px;
}

body.dark-mode .tabs {
    background-color: #263238;
    border-bottom: 1px solid #37474f;
}

.tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    color: #0277bd;
}

body.dark-mode .tab-btn {
    color: #81d4fa;
}

.tab-btn.active {
    color: #01579b;
    font-weight: 500;
}

.tab-btn.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #0288d1;
}

/* 选项卡内容 */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* 隐藏相关文档片段选项卡内容 */
#related-docs {
    display: none !important;
}

/* 聊天容器样式 - 支持滚动 */
#conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    margin-bottom: 6px;
    border: none;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    min-height: 400px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(66, 165, 245, 0.4) transparent;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c5cae9 0%, #e8eaf6 50%, #bbdefb 100%);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 212, 250, 0.8);
}

body.dark-mode .chat-container {
    border: 1px solid #37474f;
    background-color: #1e1e1e;
}

body.dark-mode .chat-container::-webkit-scrollbar-track {
    background: rgba(55, 71, 79, 0.3);
}

body.dark-mode .chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c5cae9 0%, #e8eaf6 50%, #bbdefb 100%);
}

body.dark-mode .chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 212, 250, 0.6);
}

/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    justify-content: flex-end;
}

.assistant-message {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 95%;
    padding: 14px 18px;
    padding-top: 24px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    word-break: break-word;
    transition: all 0.3s ease;
}

.message-bubble:hover .message-actions {
    opacity: 1;
    visibility: visible;
}

.message-content {
    margin-bottom: 8px;
}

.message-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.message-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.message-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode .message-action-btn {
    background: rgba(55, 71, 79, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-mode .message-action-btn:hover {
    background: rgba(55, 71, 79, 1);
}

/* 消息标识样式 */
.message-bubble::before {
    content: attr(data-sender);
    position: absolute;
    top: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 8px;
    opacity: 0.7;
}

.user-message .message-bubble::before {
    content: 'Me';
    left: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border: none;
}

.assistant-message .message-bubble::before {
    content: 'Assistant';
    left: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    color: rgba(1, 87, 155, 0.8);
    border: none;
}

body.dark-mode .user-message .message-bubble::before {
    background-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: none;
}

body.dark-mode .assistant-message .message-bubble::before {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(129, 212, 250, 0.9);
    border: none;
}

.user-message .message-bubble {
    background: white;
    color: #333333;
    border-bottom-right-radius: 6px;
}

body.dark-mode .user-message .message-bubble {
    background-color: white;
    color: #333333;
}

.assistant-message .message-bubble {
    background: linear-gradient(135deg, #c5cae9 0%, #e8eaf6 50%, #bbdefb 100%);
    color: #555555;
    border-bottom-left-radius: 6px;
}

body.dark-mode .assistant-message .message-bubble {
    background: linear-gradient(135deg, #c5cae9 0%, #e8eaf6 50%, #bbdefb 100%);
    color: #555555;
}

/* 系统消息 */
.system-message {
    text-align: center;
    margin: 20px 0;
    animation: fadeIn 0.3s ease-in-out;
}

.system-message .message-content {
    display: inline-block;
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 14px;
}

/* 欢迎消息特殊样式 */
.welcome-message .message-content {
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.6) 0%, rgba(187, 222, 251, 0.4) 100%);
    color: #0277bd;
    padding: 16px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    border: 1px solid rgba(33, 150, 243, 0.1);
    text-align: center;
    line-height: 1.5;
    animation: welcomeGlow 3s ease-in-out infinite alternate;
    transition: all 0.3s ease;
}

.welcome-message .message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.12);
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.7) 0%, rgba(187, 222, 251, 0.5) 100%);
}

.welcome-message .subtitle {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #0288d1;
    margin-top: 6px;
    opacity: 0.8;
    animation: subtitleFade 2s ease-in-out infinite alternate;
}

body.dark-mode .welcome-message .message-content {
    background: linear-gradient(135deg, rgba(38, 50, 56, 0.7) 0%, rgba(55, 71, 79, 0.5) 100%);
    color: #b3e5fc;
    border: 1px solid rgba(129, 212, 250, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .welcome-message .message-content:hover {
    background: linear-gradient(135deg, rgba(38, 50, 56, 0.8) 0%, rgba(55, 71, 79, 0.6) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .welcome-message .subtitle {
    color: #e1f5fe;
    opacity: 0.7;
}

@keyframes welcomeGlow {
    0% {
        box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    }
    100% {
        box-shadow: 0 2px 12px rgba(33, 150, 243, 0.15);
    }
}

@keyframes subtitleFade {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 0.9;
    }
}

body.dark-mode .system-message .message-content {
    background-color: #2e7d32;
    color: #e8f5e9;
}

.message-time {
    font-size: 12px;
    color: #90a4ae;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: right;
}

.assistant-message .message-time {
    text-align: left;
}

.message-input-container {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    background-color: inherit;
    z-index: 10;
    justify-content: flex-start;
}

#message-input {
    flex: 1.5;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    height: 42px;
    text-align: left;
}

body.dark-mode #message-input {
    background-color: #263238;
    border-color: #37474f;
    color: #e0e0e0;
}

#message-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-mode #message-input:focus {
    border-color: #81d4fa;
    box-shadow: 0 0 0 2px rgba(129, 212, 250, 0.3);
}

.send-button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-button:disabled {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-button:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:not(:disabled):active {
    transform: scale(0.95);
}

.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.send-button:not(:disabled):hover::before {
    width: 100%;
    height: 100%;
}

.send-icon {
    font-size: 14px;
}

.send-text {
    display: none;
}

/* 聊天操作按钮 - 移到右侧面板 */
.chat-actions {
    display: none;
}

.chat-actions .secondary-button {
    background: linear-gradient(135deg, #ff5252 0%, #f44336 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-actions .secondary-button:hover {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

body.dark-mode .chat-actions .secondary-button {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.5);
}

body.dark-mode .chat-actions .secondary-button:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #8b0000 100%);
    box-shadow: 0 6px 16px rgba(183, 28, 28, 0.6);
}

/* 待处理消息样式 */
.pending-message .message-bubble {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #757575;
    border: 1px dashed #bdbdbd;
    position: relative;
    overflow: hidden;
}

.pending-message .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 打字指示器样式 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9e9e9e;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

body.dark-mode .pending-message .message-bubble {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    border-color: #546e7a;
}

body.dark-mode .typing-dot {
    background-color: #81d4fa;
}

/* 搜索结果样式 */
#search-results {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    min-height: 350px;
    border: 1px solid #e1f5fe;
    border-radius: 8px;
}

body.dark-mode #search-results {
    border: 1px solid #37474f;
    background-color: #1e1e1e;
}

.search-section {
    margin-bottom: 15px;
}

.search-section-title {
    font-weight: 500;
    margin-bottom: 10px;
    color: #01579b;
    font-size: 16px;
}

body.dark-mode .search-section-title {
    color: #81d4fa;
}

.result-item {
    padding: 12px;
    margin-bottom: 10px;
    background-color: #e1f5fe;
    border-radius: 4px;
    border-left: 3px solid #039be5;
    position: relative;
}

body.dark-mode .result-item {
    background-color: #263238;
    border-left: 3px solid #0277bd;
}

/* 检索来源标记样式 */
.source-tag {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 5px;
    margin-right: 5px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    color: white;
}

.source-tag.vector {
    background-color: #00897b;
}

.source-tag.bm25 {
    background-color: #0288d1;
}

.source-tag.hybrid {
    background-color: #7b1fa2;
}

/* 文件来源标记样式 */
.file-tag {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 5px;
    margin-right: 5px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    background-color: #ff8f00;
    color: white;
}

/* 占位文本 */
.placeholder {
    color: #81d4fa;
    font-style: italic;
    text-align: center;
    padding: 30px 0;
}

body.dark-mode .placeholder {
    color: #546e7a;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(2, 136, 209, 0.3);
    border-radius: 50%;
    border-top-color: #0288d1;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 引用块样式 */
blockquote {
    border-left: 3px solid #0288d1;
    padding-left: 10px;
    margin: 10px 0;
    color: #01579b;
    background-color: #e1f5fe;
    padding: 10px;
    border-radius: 0 4px 4px 0;
}

body.dark-mode blockquote {
    border-left: 3px solid #0277bd;
    color: #81d4fa;
    background-color: #263238;
}

/* 链接样式 */
a {
    color: #0288d1;
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: #01579b;
    text-decoration: underline;
}

body.dark-mode a {
    color: #81d4fa;
}

body.dark-mode a:hover {
    color: #4fc3f7;
}

/* 代码样式 */
code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    color: #e53935;
}

pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

pre code {
    background-color: transparent;
    color: #333;
}

body.dark-mode code {
    background-color: #37474f;
    color: #ff5722;
}

body.dark-mode pre {
    background-color: #37474f;
}

body.dark-mode pre code {
    color: #e0e0e0;
}

/* 文件格式网格样式 */
.file-format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.format-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(179, 229, 252, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.format-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.2);
    border-color: rgba(2, 136, 209, 0.5);
}

body.dark-mode .format-card {
    background: linear-gradient(135deg, rgba(55, 71, 79, 0.9) 0%, rgba(69, 90, 100, 0.9) 100%);
    border: 1px solid rgba(129, 212, 250, 0.2);
}

body.dark-mode .format-card:hover {
    border-color: rgba(129, 212, 250, 0.4);
    box-shadow: 0 4px 12px rgba(129, 212, 250, 0.3);
}

.format-icon {
    font-size: 18px;
    margin-bottom: 4px;
    display: block;
}

.format-name {
    font-weight: 600;
    font-size: 12px;
    color: #01579b;
    margin-bottom: 1px;
}

body.dark-mode .format-name {
    color: #81d4fa;
}

.format-desc {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
}

body.dark-mode .format-desc {
    color: #b0bec5;
}

/* 右侧面板操作按钮区域 */
.right-panel-actions {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e1f5fe;
}

body.dark-mode .right-panel-actions {
    border-top: 1px solid #37474f;
}

.right-panel-actions .clear-chat-btn {
    width: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #5e35b1;
    border: 1px solid #c5cae9;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(94, 53, 177, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.right-panel-actions .clear-chat-btn:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #e1bee7 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(94, 53, 177, 0.2);
    border-color: #9fa8da;
}

.right-panel-actions .clear-chat-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(94, 53, 177, 0.15);
}

body.dark-mode .right-panel-actions .clear-chat-btn {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    color: #b39ddb;
    border-color: #546e7a;
    box-shadow: 0 2px 6px rgba(179, 157, 219, 0.1);
}

body.dark-mode .right-panel-actions .clear-chat-btn:hover {
    background: linear-gradient(135deg, #455a64 0%, #546e7a 100%);
    box-shadow: 0 3px 8px rgba(179, 157, 219, 0.2);
    border-color: #607d8b;
}

body.dark-mode .right-panel-actions .clear-chat-btn:active {
    box-shadow: 0 1px 3px rgba(179, 157, 219, 0.15);
}

/* 改进的文件类型指示器 */
.file-type-indicator {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    color: white;
    text-transform: uppercase;
}

.file-type-indicator.txt {
    background-color: #4caf50;
}

.file-type-indicator.pdf {
    background-color: #f44336;
}

.file-type-indicator.doc,
.file-type-indicator.docx {
    background-color: #2196f3;
}

/* 文件上传状态指示器 */
.upload-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.upload-status.success {
    color: #4caf50;
}

.upload-status.error {
    color: #f44336;
}

.upload-status.processing {
    color: #ff9800;
}

/* 混合检索特殊样式 */
.hybrid-result {
    border-left: 3px solid #7b1fa2;
    background: linear-gradient(135deg, #e1f5fe 0%, #f3e5f5 100%);
}

.vector-result {
    border-left: 3px solid #00897b;
}

.bm25-result {
    border-left: 3px solid #0288d1;
}



/* 通知系统样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #0288d1;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #f5f5f5;
    color: #333;
}

.notification-info {
    border-left-color: #0288d1;
}

.notification-success {
    border-left-color: #4caf50;
}

.notification-warning {
    border-left-color: #ff9800;
}

.notification-error {
    border-left-color: #f44336;
}

body.dark-mode .notification {
    background: #263238;
    border-left-color: #81d4fa;
}

body.dark-mode .notification-message {
    color: #e0e0e0;
}

body.dark-mode .notification-close {
    color: #b0b0b0;
}

body.dark-mode .notification-close:hover {
    background: #37474f;
    color: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        flex: none;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .chat-container {
        max-height: 400px;
    }
    
    .message-actions {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
        gap: 15px;
    }
    
    .panel {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .message-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .send-button {
        width: 100%;
        justify-content: center;
    }
    
    .message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        margin-top: 8px;
        justify-content: center;
    }
    
    .message-action-btn {
        font-size: 14px;
        padding: 6px 8px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
